package com.jerem.gwt.bredgolf.server;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;


@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class GolfPartieDTO {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key id;
	
	@Persistent
	private Long golfClubID;
	@Persistent
	private String typePartie;
	@Persistent
	private String commentaire;
	@Persistent
	private Date createDate;
	
	@Persistent(mappedBy = "golfPartie")
    @Element(dependent = "true")
	private List<ScoreDTO> listeScore = new ArrayList<ScoreDTO>();
	
	
	public GolfPartieDTO() {
		this.createDate = new Date();
	}

	public GolfPartieDTO(Long golfClubID, String typePartie,
			String commentaire, Date createDate, List<ScoreDTO> listeScore) {
		super();
		this.golfClubID = golfClubID;
		this.typePartie = typePartie;
		this.commentaire = commentaire;
		this.createDate = createDate;
		this.listeScore = listeScore;
	}



	public String getTypePartie() {
		return typePartie;
	}

	public void setTypePartie(String typePartie) {
		this.typePartie = typePartie;
	}

	public List<ScoreDTO> getListeScore() {
		return listeScore;
	}

	public void setListeScore(List<ScoreDTO> listeScore) {
		this.listeScore = listeScore;
	}

	public Key getId() {
		return id;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public String getCommentaire() {
		return commentaire;
	}

	public void setCommentaire(String commentaire) {
		this.commentaire = commentaire;
	}



	public Long getGolfClubID() {
		return golfClubID;
	}



	public void setGolfClubID(Long golfClubID) {
		this.golfClubID = golfClubID;
	}



	public void setId(Key id) {
		this.id = id;
	}



	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
}